﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Profile;
using System.Web.Security;

namespace IPMS.Models
{
    public class CustomProfile : ProfileBase
    {
        [SettingsAllowAnonymous(false)]
        public int ID
        {
            get
            {
                string id = base["id"].ToString();
                return Convert.ToInt32(base["id"]);
            }
            set
            {
                base["ID"] = value;
            }
        }

        public static CustomProfile GetProfile(string username)
        {
            return Create(username) as CustomProfile;
        }

        public static CustomProfile GetUserProfile()
        {
            return Create(Membership.GetUser().UserName) as CustomProfile;
        }
    }
}